﻿using System;
using System.Net.Sockets;
using System.Text;

namespace TestHarness
{
    class Program
    {
        static void Main()
        {
            IrcBot.Program.StartListening();

            try
            {
                while (true)
                {
                    var input = Console.ReadLine();

                    if (!string.IsNullOrEmpty(input) && input.Equals("quit", StringComparison.InvariantCultureIgnoreCase))
                    {
                        break;
                    }
                    
                    var message = string.Format("newbot Beginner {0}", input);
                    var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
                    socket.Connect("10.10.18.12", 8081);
                    socket.Send(Encoding.Default.GetBytes(message));
                    socket.Disconnect(false);
                }
            }
            finally
            {
                IrcBot.Program.StopListening();
            }


        }
    }
}
